package com.ruoyi.wq.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.Condition;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wq.mapper.WqActivityThemeMapper;
import com.ruoyi.wq.domain.WqActivityTheme;
import com.ruoyi.wq.domain.vo.WqActivityThemeVO;
import com.ruoyi.wq.service.IWqActivityThemeService;

/**
 * 活动主题Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-12
 */
@Service
public class WqActivityThemeServiceImpl extends ServiceImpl<WqActivityThemeMapper, WqActivityTheme> implements IWqActivityThemeService {

    @Autowired
    private WqActivityThemeMapper wqActivityThemeMapper;

    /**
     * 查询活动主题
     * 
     * @param id 活动主题主键
     * @return 活动主题
     */
    @Override
    public WqActivityTheme selectWqActivityThemeById(String id)
    {
        return wqActivityThemeMapper.selectWqActivityThemeById(id);
    }

    /**
     * 查询活动主题列表
     * 
     * @param wqActivityTheme 活动主题
     * @return 活动主题
     */
    @Override
    public List<WqActivityTheme> selectWqActivityThemeList(WqActivityTheme wqActivityTheme)
    {
        return wqActivityThemeMapper.selectWqActivityThemeList(wqActivityTheme);
    }

    /**
     * 新增活动主题
     * 
     * @param wqActivityTheme 活动主题
     * @return 结果
     */
    @Override
    public int insertWqActivityTheme(WqActivityTheme wqActivityTheme)
    {
        wqActivityTheme.setCreateTime(DateUtils.getNowDate());
        return wqActivityThemeMapper.insertWqActivityTheme(wqActivityTheme);
    }

    /**
     * 修改活动主题
     * 
     * @param wqActivityTheme 活动主题
     * @return 结果
     */
    @Override
    public int updateWqActivityTheme(WqActivityTheme wqActivityTheme)
    {
        wqActivityTheme.setUpdateTime(DateUtils.getNowDate());
        return wqActivityThemeMapper.updateWqActivityTheme(wqActivityTheme);
    }

    /**
     * 批量删除活动主题
     * 
     * @param ids 需要删除的活动主题主键
     * @return 结果
     */
    @Override
    public int deleteWqActivityThemeByIds(String[] ids)
    {
        return wqActivityThemeMapper.deleteWqActivityThemeByIds(ids);
    }

    /**
     * 删除活动主题信息
     * 
     * @param id 活动主题主键
     * @return 结果
     */
    @Override
    public int deleteWqActivityThemeById(String id)
    {
        return wqActivityThemeMapper.deleteWqActivityThemeById(id);
    }

	@Override
	public TableDataInfo getPageList(WqActivityTheme wqActivityTheme) {
		IPage<WqActivityThemeVO> page = baseMapper.selectPageList(Condition.getPage(wqActivityTheme), wqActivityTheme);
		return Condition.getTableDataInfo(page.getRecords(), page.getTotal());
	}

	@Override
	public WqActivityThemeVO getDetail(String id) {
		return baseMapper.getDetail(id);
	}
}
